home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A.C.E. 2
/
ACE CD 2.iso
/
FILES
/
DOCS
/
SBASEP4D.LHA
/
SuperBaseProFormsEditor.doc
< prev
Wrap
Text File
|
1994-11-27
|
123KB
|
2,763 lines
SUPERBASE PROFESSIONAL
FORMS EDITOR
USER GUIDE
FORMS EDITOR USER GUIDE CONTENTS
CHAPTER 1
INTRODUCTION 1-1
The Forms Editor 1-1
How to Use This Guide 1-2
CHAPTER 2
GETTING STARTED 2-1
Introduction 2-1
Basic Concepts 2-1
Forms and Pages 2-1
Objects 2-2
Fields 2-3
Menus and Dialogs 2-3
Using Dialogs 2-4
Ghosted Items 2-5
Working with Forms 2-5
Creating a New Form 2-5
Creating a New Page 2-5
Opening a Form 2-5
Opening a Page 2-6
Changing the Current Page 2-7
Saving a Form 2-7
Saving a Page 2-7
A Sample Session 2-8
Housekeeping 2-9
Directories and Subdirectories 2-9
Changing the Directory 2-10
Status 2-10
Removing Forms and Pages 2-11
Resolution (Amiga only) 2-11
CHAPTER 3
DESIGNING A PAGE 3-1
Design Tools 3-1
Overview 3-1
Note 3-2
i
Cancelling an Operation 3-2
Summary 3-2
Fields 3-3
Field Options 3-3
Lines 3-4
Boxes 3-4
Areas 3-4
Text 3-4
Images 3-5
Attributes 3-6
The Attributes Window 3-6
Pen/Paper Selector 3-7
Pen 3-8
Pen and Paper 3-8
Colour Palette 3-9
Object Print Status 3-9
Text Styles 3-10
Field Justification 3-10
Read Only 3-10
Area Patterns 3-11
Line Thickness 3-11
Text Fonts 3-11
Crosshairs 3-12
Align 3-12
Reduce 3-13
CHAPTER 4
EDITING FORMS 4-1
Hierarchy of Objects 4-1
Selecting Objects 4-2
Editing a Page 4-2
Undo 4-3
Clear 4-3
The Clipboard 4-3
Cut 4-3
Copy 4-4
Paste 4-4
Move 4-4
Moving a Group of Objects 4-5
Size 4-5
Editing Attributes 4-5
Editing Text 4-6
ii
Changing Pages 4-6
To Front 4-7
Swap 4-7
Cut 4-7
CHAPTER 5
FORMS, FIELDS AND FILES 5-1
Calculation 5-1
Using Report Functions in Calculations 5-2
Validation 5-3
Replicating Fields 5-3
Setting the Field Order 5-3
Linking Files 5-5
Using the Link Option 5-5
A Two File Example 5-5
Linking More than Two Files 5-6
Editing Existing Links 5-7
Limits of the Linking Capability 5-7
CHAPTER 6
PRINTING FORMS 6-1
Printing a page 6-1
Print Options 6-1
Draft Printing 6-2
Graphics Printing 6-2
Print Zones 6-3
Object Print Status 6-3
CHAPTER 7
GENERATING REPORTS 7-1
Overview 7-1
A Note on Graphics and Text 7-1
Creating a Report: Step by Step 7-2
Preparation 7-2
Selecting Fields to be Printed 7-2
Specifying a Report Heading 7-2
Specifying a Report Footing 7-3
Groups 7-3
Specifying a Group 7-3
The BEFORE GROUP Box 7-4
iii
The AFTER GROUP Box 7-4
Multiple Groups 7-5
Specifying Report Functions 7-5
The Report Filter 7-5
Sorting 7-6
Saving the Report Form 7-6
Refining Your Report 7-6
Title Page 7-6
Totals Page 7-6
Summary Reports 7-6
Page On Group 7-7
CHAPTER 8
USING FORMS AND REPORTS 8-1
Opening a Form 8-1
Single File Forms 8-1
Multiple File Forms 8-2
Browsing with a Form 8-2
Current Record/Page Selector 8-3
Change Index 8-3
Temporarily Changing the Master File 8-3
Lookup 8-4
Filters 8-4
Switching to the Default Views 8-4
Reselecting the Form 8-5
Data Entry and Editing 8-5
Field Entry Order 8-5
Data Entry: Record New 8-6
Committing the Form: Record Save 8-6
Batch Data Entry 8-7
Editing a Form 8-7
Snapshot Data Entry: Record Duplicate 8-7
Removing Form Data: Record Remove 8-8
Reports 8-8
Running a Report 8-8
Adding Filter Conditions 8-8
Adding Order Conditions 8-9
Print/Display Option 8-9
Modifying a Report Program 8-10
Output device 8-10
Filter and Order 8-10
Forms and the Project Menu 8-10
iv
Open Fields 8-10
Close Form 8-10
Edit File 8-11
Remove File or Index 8-11
v
CHAPTER 1 - INTRODUCTION
THE FORMS EDITOR
Superbase Professional's Forms Editor can be treated as three program in
one, each of them equally useful and each complementary to the others.
First, the Forms Editor acts as a front end to Superbase Professional. You
can design a form around a particular file and then use it both to display
the file's data on screen and to enter new data. When it is used in this
way, the Forms Editor provides a similar facility (only considerably more
powerful) to Superbase's Form View option.
More important than this single file facility is the way it simplifies the
task of relating data from different files. Here the Forms Editor acts as
an intelligent front end which can handle and process the data from
multiple Superbase files. A form can be set up to display fields or records
from two or three (or more) files at the same time.
For data entry, you could design a form to store each line in a separate
field, or in a separate record, or even in a separate file. Using Superbase
functions such as Lookup, you can build cross-file validation and
calculation into a form, so that it checks new data against records in
other files. Another of the program's facilities lets you specify the order
in which data is entered in a form.
Alongside this, the Forms Editor serves as a fully fledged design and
drawing package. In this capacity it allows you to create multi-page forms,
combining colour, lines, boxes, and text as you please. An extensive set of
editing facilities then enables you to alter almost any feature on a page
with just a few clicks on the mouse. There is also an option for
integrating graphic images - company logos or letterheads, for example -
created in other programs. Once a form has been designed, it can be printed
out, photocopied and used for everyday business purposes.
Business, in fact, will probably be the area where the program finds the
widest application - for invoices, order forms, expense forms, stock
control, marketing questionnaires, etc. - but it is just as suitable for
producing the kind of forms used in many other areas such as research and
education.
The Forms Editor's third role is as a report generator. Superbase
Professional already includes a report facility, but the Forms Editor
supplements this with a greater range of report formatting and report
analysis features. Here again, it
1-1
is as easy to extract and summarize data from multiple files as it is from
single files. Then you can lay out the elements on your report with far
greater flexibility than before. You can also produce multi-page reports
with separate title and totals pages.
HOW TO USE THIS GUIDE
Chapter 2, Getting Started, is intended to provide a quick guide to the
Forms Editor. It takes you up to the point where you can open a new form,
design a page, save it on disk, and then load it back in to be edited. At
the same time, it introduces you to the handful of basic concepts that you
will need before you can feel fully at home with the Forms Editor. This
chapter, then, is the only one that needs to be read from start to finish.
The other chapters can be treated as reference material - to be consulted
only when you need additional information on a particular topic.
Chapter 3, Designing a Form, describes the options which the Forms Editor
provides for designing a form. These are the tools you will use to add
fields, text and graphics to a page.
Chapter 4, Editing a Form, explains how to modify a form after it has been
created.
Chapter 5, Fields and Forms, covers the more advanced options associated
with adding fields to a form. These include Calculation, Validation, and
setting the field order.
Chapter 6, Printing a Form, explains how to print a form, and describes the
various print options.
Chapter 7, Generating Reports, shows you how to create a form which will
produce a report when it is loaded into Superbase.
Chapter 8, Using Forms and Reports, describes the various ways in which you
can use forms in Superbase for entering or retrieving data and for
producing reports.
1-2
CHAPTER 2 - GETTING STARTED
INTRODUCTION
You should find the Forms Editor easy to use, especially if you are already
familiar with Superbase itself. However, there are several concepts that
are crucial to understanding the way the Forms Editor works. If you have a
clear idea of these, it will make the task of mastering the Forms Editor
that much easier. The first part of this chapter explains these basic
concepts.
The second section, Forms and Pages, describes how to open forms and pages,
how to create new forms and pages, and how to save them on disk. By taking
you through a sample session, it then shows you how to design a simple one
page form.
In the last section, Housekeeping, we describe the facilities which are
provided by the Forms Editor for handling the files you create on disk.
BASIC CONCEPTS
FORMS AND PAGES
So far we have used the term 'form' in its usual sense where it covers a
wide range of different kinds of printed material: invoices, data entry
forms, customer receipts, and so on. However, in this manual and in the
program itself (on menus and dialogs) the term 'form' also has a more
precise sense, in which a form means a collection of 'pages'.
A single page measures 240 characters across by 66 lines. On the screen,
you can only see part of a page, but you can scroll around it using the
scroll bars. You can things of a page as three A4 sheets laid together side
by side; each sheet can contain 66 lines of 80 characters. When you come to
print out a page, you have a choice of printing any one of these three
sheets.
The main advantage of making a distinction between forms and pages is
flexibility. It means that you can design and save pages on their own, and
then build up a form from different pages. You can use the same page or
pages in different forms, and you can repeat the same page in a single
form. You can even edit a form by altering the page order or deleting and
inserting pages.
2-1
The points raised in this section can be summarized by four rules relating
to forms and pages:
1. A form may consist of a single page or multiple pages.
2. A form consisting of only one page can be saved either as a form or as a
page.
3. A form consisting of more than one page can only be saved as a form.
4. You cannot load another form into your current form, but you can load a
page into your current form.
Note also that a saved form is identified by the extension '.sbv', while a
page is identified by the extension '.pg'.
OBJECTS
Whenever you add something to a page, whether text or graphics, the Forms
Editor identifies it as an 'object'. A line, a box, a field, a line of
text, an area, an image - each of these is treated as a separate object. In
this way, the program keeps track of all the elements that make up a page.
As such, it contrasts with other drawing and design packages that allow you
to build up an image on screen but do not keep the details of the separate
components of an image.
Taking an 'object-oriented' approach has several advantages, particularly
when you want to edit a page. It makes it easy to select any part of a page
and alter it, for example by moving it to a new position or resizing it.
Another advantage is that you can instruct the Forms Editor to print out
only certain types of object - to leave out the text on a page, for
example, or to ignore any shaded areas.
The Forms Editor recognizes six types of object:
Areas
Boxes
Lines
Images
Text
Fields
Apart from areas and images, it should be clear what each of these types
represents. Thus a line is a straight line, and a box is a rectangular box.
Areas are filled boxes; that is, boxes which have been filled with the same
colour and pattern as the lines that make up their sides. Images are
pictures
2-2
which have been created by another program such as Gem Paint, and then
imported into a Forms Editor page.
Generally, each distinct element on screen forms a separate object. So, a
line of text or a graphics line is usually a single object. But it is
perfectly possible to construct a line (or any other item on screen) from
several objects; you can make a long line from a number of short lines
joined together.
What actually defines something as an object is the fact that it is created
in one operation. In other words, pressing the mouse button after drawing a
line defines it as a single object; similarly, pressing the Return key
after typing something in means that it will be treated as a text object.
At this stage, you will find it helpful if you start thinking of a Forms
Editor page as a collection of different types of objects. Chapter 3
describes the options for adding objects to page. Chapter 4 explains how to
select objects in order to modify them or reorganize them on the page.
FIELDS
Fields provide the link between the Forms Editor and Superbase.
These are the elements that enable you to use a form within Superbase,
either for entering data in a file or for retrieving data. By attaching
calculation and validation formulae to fields, you can give a form its own
data processing capability. Working together, these features allows you to
build relational links between different files into a form; or to set up a
form that calculates results automatically as soon as data is entered in a
field.
Although fields are treated as objects in the same way as lines or text,
there are two important differences. First, a field must already exist in a
Superbase file before it can be added to a form. Second, the contents of a
field are not shown on screen until it is used within Superbase; instead,
the Forms Editor draws a field box where the contents will appear. When you
come to use the form from Superbase, the field will either show the
contents of a particular record, or it will be blank, ready for data
entry.
MENUS AND DIALOGS
The Forms Editor functions and controls are available from five menus.
These work in the same way as other Superbase menus: to display (or pull
down) a menu, move the mouse pointer over the menu heading on the bar at
the top of the screen (On the Amiga, click the right mouse button to
display the menu bar). The Forms Editor will then display the menu
associated with the heading.
2-3
On Gem versions, you can select an item on the menu by moving the pointer
over it and clicking on the left mouse button. As you do this, the Forms
Editor highlights the item and, once you have clicked the mouse button,
withdraws the menu. If you want to de-select a menu, move the pointer away
from the menu bar and click the mouse button.
On the Amiga, you select an item by highlighting it with the pointer and
then releasing the right mouse button.
When you select certain items such as Attributes on the Edit menu or Open
Page on the Project menu, you will be presented with another menu or a
dialog, which gives you a further set of items to choose from.
USING DIALOGS
Almost all the Forms Editor dialogs include a choice of some kind, and
require you to select an item.
Some dialogs show a panel that contains a list of names such as file names
or directory names. There are two ways of selecting a name:
Click once on the name to place it in the Selection Box. Then click on OK.
With some dialogs you may be able to press Return instead of clicking on
OK. Double click on the name.
As a further alternative, you can also type the name directly into the
Selection Box.
The dialog panel may be only a few lines long, so there may be more files
then can be shown at one time. If there's a gap at the bottom of the scroll
bar there are more items to be viewed. You can show them by dragging down
the scroll bar at the right of the panel, or by clicking on the downwards
pointing arrow gadget below the scroll bar.
One very important fact about dialogs is that you must respond to them
before you can do anything else. Most dialogs have a Cancel button.
Clicking on this returns you to whatever you were doing previously. If
there's no Cancel button there is certain to be an OK button, and you can
safely click on this once you've read the dialog.
Some dialogs include a Clear button. This has the effect of removing
anything that's in the Selection Box, and can be used at any time.
2-4
GHOSTED ITEMS
You will notice that some menu items are 'ghosted' and appear in faint
script. This means that they are temporarily unavailable. usually the
reason is that they require you to perform some other operation before they
become available. Thus, you cannot add a field to a page if there are no
fields to select, so the Fields option remains ghosted until you load a
Superbase file.
Some of the font options on the Font menu may be ghosted for another
reason: because they are not available to the system.
WORKING WITH FORMS
CREATING A NEW FORM
The New Form item on the Project Menu is used to start a new form. However,
when you load the Forms Editor, the opening screen presents you with a
blank untitled page. You can treat this as the first page in a new form.
New Form, therefore, only needs to be used when another form has already
been opened. You may have loaded a form from disk and edited it, or you may
have already created a new form and saved it on disk. If you now want to
start work on a new form, you need to select this menu item in order to
clear the first form from memory.
CREATING A NEW PAGE
Selecting the New Page item on the Project menu inserts a blank page after
the current page. For example, if the current page is Page 2, the new page
will be Page 3.
Use this option when you want to add a new page to a form. It does not
clear any pages that have already been opened.
When you create a new form, you will notice that the New Page menu item is
ghosted. It does not become available until an object has been added to the
first page in the form.
OPENING A FORM
You use the Open Form item on the Project menu to load a form from disk.
Select this option when you want to edit a form you have created
previously, or when you want to view a form.
Selecting Open Form brings up a dialog which shows a list of the forms in
the current directory. You can scroll down the list using the scroll bar at
the
2-5
side. Once you have selected the form you want to open, you can either
double click on the form name or click once on the name and then again on
the OK gadget.
If a form has already been opened, it will be replaced by the form selected
with Open Form. You cannot use the Open Form option to join two forms
together - for this you need to use Open Page.
OPENING A PAGE
The Open Page item on the Project menu opens a page that has previously
been saved on disk.
Open Page works in the same way as Open Form except that it does not
replace any pages that may have already been opened. Like Open Form,
selecting Open Page brings up a dialog showing a list of page files on
disk. But when you select a page from the list, it is inserted in the form
after the current page. If you have just opened a new form, the page will
be Page 1; if there are already four pages in your form and the current
page is Page 3, the page you select will become Page 4. The previous Page 4
will then become Page 5.
Open Page allows you to create new forms from old. Here are some of the
ways this option can be used:
To load a single page so that it can then be edited.
To join two forms together.
To create a new form using the pages from other forms (or from a library of
pages).
To repeat pages.
Open Page works with pages that have been saved individually as pages (as
'.pg' files), using the Save Page option. You cannot use Open Page to load
pages that have been saved with the Save Form option. If you want to add
the pages from one form to the pages in another, you will need to save them
separately.
Note that when you save a page, it is not stored on disk with its current
page number. This means that you can open the same page as many times as
you wish in the same form - you can repeat pages.
Of course, it is unlikely that you will need to create a form with every
page exactly the same. This feature, though, is useful for creating forms
in which there are only small differences in each page. It lets you repeat
a page and then edit in the differences.
2-6
CHANGING THE CURRENT PAGE
The first three items on the Page menu - Goto, Next and Previous - enable
you to change the current page. These options only work with pages that
have already been opened.
Selecting Goto brings up a dialog which allows you to type in the number of
another open page. When you press Return or click on OK, the Forms Editor
makes the page whose number you have entered the current page and displays
it in the page window.
The Next option takes you onto the next page. For example, if you have
opened a form with four pages and the current page is Page 2, Next makes
Page 3 the current page.
The Previous option takes you back to the previous page; if you are on Page
3, it makes Page 2 the current page.
SAVING A FORM
Use the Save Form item on the Project menu to save the current form on
disk. Selecting this option brings up a dialog where you can type in the
form's name. If you enter the name of form which already exists, you will
be asked if you want to replace the form on disk. Click on OK if you want
to save a new version of the form under its old name; otherwise click on
Cancel and then save the form under a new name.
This option saves all the pages in a form in their current order. If the
form has only one page, it is saved as a single page form.
When Save Form stores a form on disk, it adds an '.sbv' extension to the
form name.
SAVING A PAGE
To save the current page on disk, select the Save Page option on the
Project menu. This operates in the same way as Save Form, using a dialog.
Save Page ignores the current page's number. Once a page has been saved
with this option, it can then be inserted at any point in a multiple page
form (see Opening a Page).
Separate pages are stored on disk with the '.pg' extension name.
2-7
A SAMPLE SESSION
Assuming you have just loaded the Forms Editor, your screen should look
like this:
PROJECT PAGE EDIT SET REPORT FONT FORM
Untitled: Page 1
The Forms Editor provides a number of options on the Set menu for drawing a
page and adding text to a page. We refer to them here as design tools.
The Line option enables you draw straight lines. This is the default design
tool, so you can start drawing a line straight away.
Position the drawing cursor (the small cross) anywhere in the display area
and click the left-hand button of the mouse.
Move the pointer to the right. As you do this you will see that you have
started to draw a straight dotted line from the position where you clicked
the mouse, to where the cursor is currently located. Now decide where you
want to draw the line to, and click the left-hand mouse button. The line
will then be drawn on screen as a solid line.
Now draw a vertical line. As before, position the cursor anywhere on screen
and click the mouse button. Then move the cursor down and click the mouse
button a second time.
Lines can be drawn in different colours, different patterns, and with
different thicknesses. These features, which are explained in Chapter 3,
are known as a line's attributes. It is even possible to change a line's
attributes after it has been drawn. But for the purposes of this example,
we will stick to the default attributes.
You can now add other objects to the page, using the Box and Area design
tools.
2-8
First you need to select Box from the Set menu. Move the cursor to the Set
menu and click on Box. Then position the cursor somewhere in the Page
window and click the left-hand button. You can now draw a box by moving the
cursor down to the right. When you have drawn the box to the dimensions you
want, click the left-hand button again to fix it on the page.
To draw an area, first select Area from the Set menu and then repeat the
procedure for drawing a box.
Adding a field to the page is only slightly more complicated then adding a
graphics object. The first step is to open a Superbase file using the Open
File option on the Project menu. With a file open, select Fields from the
Set menu. You will then be presented with a fields options dialog. For the
time being we will ignore these options, so you should now click on OK.
This action takes you back to the page window. Position the cursor anywhere
in the window and click the mouse button; another dialog will appear, this
time showing a list of fields for the current file. When you select a field
from the list - by doubling clicking on it, or clicking once and then again
on OK - the Forms Editor will draw a field box on screen at the point where
you last positioned the cursor.
There is no practical limit to the number of objects you can add to a page.
You may now like to carry on with the same page, or you can clear the page
- using the Clear option on the Page menu - and start again. At any point
you can store your page on disk, using Save Page from the Project menu.
This section, however, is only intended to get you started on the process
of designing a form. The next chapter covers the design tools in more
detail.
HOUSEKEEPING
Housekeeping covers a variety of different topics: looking at the disk
directory, changing the directory, removing forms from disk, and removing
pages. Although these operations do not have a direct bearing on the task
of creating a form, they need to be explained early on. As your disk fills
up with more and more Forms Editor files, you will appreciate the
importance of organizing them properly. It is as well to start off as you
mean to continue.
DIRECTORIES AND SUBDIRECTORIES
If you are running the Forms Editor on a hard disk machine, it is a good
idea to store forms and pages in a separate directory from the program
itself. You
2-9
may want to create several subdirectories; for example, one for Superbase
files and one for forms and pages. But if you intend to use a form for
displaying Superbase data, it should be in the same directory as the
Superbase file. Your operating system manual will tell you how to create a
subdirectory. This needs to be done before you load the Forms Editor.
If you have a floppy disk system, you are recommended to create a data disk
for storing pages and forms separately from the program itself. Remember
that you will have to format a blank disk before using it as a data disk.
CHANGING THE DIRECTORY
Within the Forms Editor you can change the current directory and the
current drive using the Directory option on the Project menu. Directory
displays a dialog which lists all the directories below the current level;
i.e. if you are already at the bottom of the directory tree, the dialog
will be empty.
You can select a directory from the list in the usual way by clicking on OK
or double clicking. Selecting '..' ('/') takes you to the next level up the
directory tree.
If you want to change to a directory in another branch of the tree, you
will need to type in its name and pathname. For example, if you had a
directory called Images, which was a subdirectory of SBforms, typing
\SBforms\Images
/SBforms/Images would make Images the current directory.
To change to another drive, type in the drive name - a:, b:, c:, or d:
(DF0:, DF1:, DH1:).
After typing in a directory name or a drive name, click on OK or press
Return.
STATUS
The Status option on the Project menu provides information about various
aspects of the system. You can use it, for example, to find out how much
memory is left, or to find out where you are in the directory tree.
Selecting Status brings up a dialog showing:
The Superbase files that have been opened.
The current directory.
2-10
The number of pages in the current form.
The amount of space remaining on the current disk.
The amount of free memory.
REMOVING FORMS AND PAGES
Remove Form and Remove Page allow you to delete a form or a page from the
disk. These options work in the same way as the equivalent operating system
commands, such as Erase in MSDOS and Delete in AmigaDOS: they delete the
specified file from disk, and make the space it occupied available for
further storage. Use Remove when you are running short of disk space, or
simply to keep your directories tidy by deleting files that are no longer
used.
RESOLUTION (AMIGA ONLY)
On the Amiga, the Project menu includes a Resolution option which allows
you to set the screen resolution and the number of colours. This gives you
a choice of four different resolution and colour settings:
Interlace on
4 Colours
8 Colours
16 Colours
You will find details of the video attributes for each of these settings in
the Amiga User Guide.
When you save a form on disk, the current resolution setting is saved with
it. When you load the form into memory, the screen will automatically be
set to the same resolution.
2-11
CHAPTER 3 - DESIGNING A PAGE
This chapter explains how to design a page. The term 'design' covers any
and all of these activities:
Selecting different types of object to appear on a page.
Adding objects to a page.
Sizing objects.
Positioning objects on page.
Setting an object's attributes - such as its colour and pattern.
Aligning objects with each other.
One aspect of designing a page which is not covered here is the option for
defining validations and calculations for fields. These are explained in
Chapter 5.
DESIGN TOOLS
You will notice that the Set menu is divided into two groups of options.
The options in the top group are the ones you use to add an object to a
page. We refer to these as design tools. This section describes all the
design tools except Calculation, and Validation (see Chapter 5).
OVERVIEW
The procedure for using any of the design tools is essentially the same for
all the options in the Set menu.
First select the design tool by pulling down the Set menu and selecting the
appropriate item. Move the pointer (the small crosshairs) to the position
in the forms window where you want to place the object. Now click the left
mouse button to start creating an object.
If you have selected one of the graphics options - Line, Box, and Area -
you can now draw the object to the size you require by moving the pointer.
As you do this, the Forms Editor uses a dotted line to show where the
object will appear and how big it will be.
When you have decided what you want the object to look like, click the left
mouse button again. The Forms Editor will then draw it on screen according
to the position and dimensions you have selected.
If you have selected the Text option, creating an object means typing in
text
3-1
from the keyboard. When you have finished, you can either click the left
mouse button a second time or press the Return key.
After you have selected Field, Calculation, or Validation, clicking the
left mouse button will present you with a dialog. Chapter 5 explains how to
proceed from there. The other Set menu option, Image, is covered in a later
section in this chapter.
NOTE
If you are familiar with other drawing or design programs, you may find
some of the techniques used here slightly different. With some programs,
you need to keep the mouse button pressed down while you draw a line, for
example. Releasing the button then 'fixes' the line on the screen.
With the Forms Editor, things are much easier; you can take your hand away
from the mouse in the middle of creating an object, and you can use the
scroll bar to move the window to another part of the form. This gives you
the chance to examine the picture and decide exactly what dimensions you
want the object to have.
CANCELLING AN OPERATION
On the Amiga, you can interrupt an operation by clicking the right mouse
button. With Gem versions of the Forms Editor, once you have selected one
of the graphics design tools - Line, Box, and Area - it is not possible to
cancel the operation halfway through. Once you have started, you must
complete the operation by clicking the mouse button a second time. As a
result, you will sometimes find you have added an object to the page by
mistake.
If you want to cancel the effects of the last operation, use the Undo
option from the Edit menu. This removes the object you have just created.
At a later stage, you can still remove any object, using Cut from the Edit
menu.
Undo also works with the other design tools. However, with the Text option,
the Forms Editor only creates an object if you type something in. This
means you can cancel the operation by deleting characters and pressing the
Return key. The other design tools - Field, Calculation, and Validation -
bring up dialogs which provide Cancel buttons (so the problem doesn't
arise).
SUMMARY
Creating an object is a two click process. Click the left mouse button once
3-2
to start. Create the object - draw it, type it, or in the case of fields
and calculations, select it from a dialog - and then click again to fix it
on the screen. If you change your mind immediately after creating an
object, use the Undo option to remove it from the page.
FIELDS
Before you can add a field to a page, you need to open the Superbase file
which the field belongs to. Do this in the same way as you would in
Superbase itself: from the Project menu select the Open File option and
then use the File dialog to select a file.
Provided a file is open, you can place any of its fields anywhere on a
page. You can add fields from more than one file to the same page, and you
can repeat the same field as many times as you wish (see the section on
replicating fields further on in this chapter).
The procedure for adding a filed to a page is as follows:
1. Select Field from the Set menu.
2. Set the field's attributes from the fields options dialog (see next
section), then click on OK.
3. Position the cursor on the page at the point where the field is to be
added. Then click the left mouse button.
4. Select a filed from the Fields dialog and click on OK, or double click
on the field name. If you want to select a field belonging to another
open file, you must first click on the upward pointing arrow to the
right of the File Name Box. This action selects the next open file, and
displays its name and the field names that belong to it. You can cycle
through all the open files by repeated clicking on the arrow.
5. The field will then be added to the page at the point where you placed
the cursor.
FIELD OPTIONS
The fields options dialog is presented when you select Field from the Set
menu. it provides two options governing the way a field is added to a page:
auto field names and auto field borders.
If you set the auto field names option, the name of the selected field is
added to the page as a text object in the standard System font. It is
placed at the left of the field box.
3-3
The auto field borders option determines whether the field box is drawn
with or without borders. By default, this option is not set, and the field
box is drawn with a dotted line. When you select auto field borders, the
Forms Editor draws the box with a border using a fixed pattern. If you
print a form or load a form from within Superbase, the field will be shown
with its border; the dotted lines around a field box only appear in the
Forms Editor itself.
LINES
The Forms Editor allows you to draw straight lines vertically or
horizontally (but not diagonally).
The position of the pointer when you click the left mouse button forms the
starting point for a line. Moving the pointer left, right, up or down,
draws a line in that direction from the starting point. It is not necessary
to move the pointer directly above or directly to the side of the starting
point - the program checks to see if you are closer to the vertical or the
horizontal and draws a vertical or horizontal line accordingly.
While you are drawing, the Forms Editor shows a dotted line. When you click
the mouse button for a second time, the Forms Editor draws the line on
screen in the current colour, thickness, and pattern (see the section on
Attributes).
BOXES
As with drawing a line, the initial position of the pointer on screen sets
the starting point of a box. You can then draw a box by moving the pointer
in any direction. As you do this, the Forms Editor expands the box to the
new cursor position. In effect, drawing a box involves dragging the
diagonally opposite corner away from the starting point.
Once you have settled on a particular size and shape for the box, click the
mouse button again to fix it on the screen. The Forms Editor will then draw
it using the current colour, thickness and pattern.
AREAS
An area is a box that is filled with the currently selected pattern in the
current foreground colour. It is drawn in exactly the same way as a box.
TEXT
Text objects are created in the same way as any other objects. Select Text
from the Set menu and position the cursor where you want the line of text
to start. Click once and type in your characters. As you do this the
characters are shown
3-4
on screen in the selected colour and style attributes, and in the selected
font. Pressing the mouse button or the Return key completes the operation
and fixes the text on the screen.
If you make a mistake while you are typing text in, you can edit it using
the cursor keys together with the Del and Backspace keys. Move the cursor
to the part of the line you wish to correct. Del then deletes the character
to the right of the cursor; Backspace deletes the character to the left.
(You can also edit the text after you have pressed Return - see Editing
Text, Chapter 4.) Note that when you type in text, any characters to the
right are pushed further along the line. In wordprocessing terms, text
entry is always in Insert mode.
IMAGES
The Forms Editor allows you to load images created with paint programs into
the form. You could design your company logo with a program such as Gem
Paint or Aegis Images, and incorporate it onto screen forms, which you
could then print out as stationery masters for manual office work.
When you want to place an image on the form, it's best to move it into the
current directory before starting work with the Forms Editor.
Select Image from the Set menu. Now position the mouse pointer at the place
where you want the top left corner of the image to appear. Double click,
and hold down the mouse button while you drag out the box that is to
contain the image. Make the box larger than the image - it's easy to make a
loaded image smaller, but impossible to make it bigger.
When you click to fix the lower right corner of the image box, the Forms
Editor presents you with a list of the current files on the disk, from
which you will choose your image. As there is no way of distinguishing
suitable image files, the list is not selective. This means that you must
be careful to choose a compatible image file, such as .img for GEM, IFF for
Amiga, and NeoChrome or Degas for Atari.
Select the image you want, and click on OK. The Forms Editor loads the
image into the screen. Bear in mind that loading images created in one
resolution into a form that is being created in another will have
unpredictable results. The colours, or the aspect ration, or both, may be
wrong.
Sometimes it is necessary to have a deliberate distortion of an image on
the screen in order to produce a correct result on the printer, because of
the difference in the aspect ratios of the two devices. The software leaves
it up to you to arrange things to suit your own configuration, rather than
forcing
3-5
you into an outcome which might not be what you wanted.
If you want to clip the image, use the Set Size option. You can only clip
an area that begins at the top left corner - it's not possible to size the
image and leave only the lower left corner, for example. If the results do
not please you, go back to the paint program and change the source image
file.
Images take up quite a lot of memory. If you try to load multiple images
into the form, you may run out of memory.
ATTRIBUTES
THE ATTRIBUTES WINDOW
Selecting Attributes from the Edit menu opens the Attributes window. When
you first open the window, only the top half is shown. On Gem versions,
clicking on the diamond in the top right-hand corner (bottom right-hand
corner on the Amiga) opens the window up to its fullest extent; clicking on
the diamond a second time closes the window to half size. You can also move
the window to a new position on the screen.
Once you have set up the window in the way you find most convenient, it can
be left on screen so that it is always available while you are designing a
form. Alternatively, you can close the window and then call it up when it
is needed. The Attributes window enables you to change any of the following
settings:
The colour of the drawing pen.
The background colour.
The pattern in which lines, boxes and areas are drawn.
The text style-select Normal or any combination of Italic, Bold, and
Underlined.
The field justification-set a field so that its contents are left or right
justified, or centered.
Read Only-set this for a field or calculation to prevent the user from
entering data in the file or calculation.
The thickness of a line.
The colour palette-by selecting a different colour from the palette, change
any colour on screen instantly.
The object print status-choose whether any object or group of objects is to
be printed or not.
3-6
(PICTURE OF ATTRIBUTE SCREEN)
To set one of these attributes, move the pointer over its box and click
once. If you have set one of the attributes in the top two lines-to the
right of the pen/paper selector-it will then be highlighted.
Note: when you are designing a form, there is no need to worry about
whether you have selected the right attributes for your objects. An
object's attributes are not fixed and can be changed at any stage: the
background and foreground colours, the thickness of a line, text style,
area pattern-all these can be changed after the object has been drawn.
Chapter 5 covers this facility in more detail.
PEN/PAPER SELECTOR
This option is used to set the foreground or background colour for the next
object to be drawn. The circle in the middle shows the current foreground
colour. If you think of the Forms Editor as using a pen to draw objects,
the foreground colour is the colour that the pen draws in.
You can change the pen colour by clicking on one of the 16 colours in the
colour panel. First, though, you need to make sure that you select a colour
for the pen rather than for the paper. Do this by clicking the mouse button
while the pointer is inside the circle.
To change the paper colour (the background colour) click outside the circle
and then select one of the colours from the panel below.
3-7
PEN
There two ways of using colour in the Forms Editor. They are referred to
here as two colour modes. In Pen mode you can set the pen colour but not
the paper colour. Any object you create is then drawn in the current pen
colour against the existing paper colour.
Pen mode is the default colour mode. If you have selected the other mode,
Pen and Paper, you can switch back to Pen by clicking in the Pen box.
PEN AND PAPER
In this colour mode, both the pen (foreground) colour and the paper
(background) colour can be selected. The main applications for this mode
are with text and areas; but you can also use it to draw lines and boxes,
using an area pattern in two colours (see the section on Area Patterns
later in this chapter).
With text, the Pen and Paper colour mode allows you to set the background
colour for a line or even for each character. With areas, it has the effect
of filling in the spaces (shown in white in the area pattern panel) in a
pattern, using the selected paper colour.
The Pen and Paper colour mode is best illustrated by an example. First
select Text from the Set menu and then select the Attributes window. The
next step is to select Pen and Paper mode by clicking in its box. Using the
Pen/Paper selector, make the pen colour blue and the paper colour red (or
white and black if you have a monochrome display). If you now click in the
page window and type something in, you will see that the characters are
shown in blue, while the background colour for the line is red.
Note that Pen and Paper only allows you to select the background colour for
an object, and not for the whole page. By default the paper colour for the
page is white. On the Amiga, you can change this to another colour using
the Palette; but with Gem versions it is not possible to alter the paper
background for the page from within the Forms Editor.
However, there is an easy way round this problem if you want to print forms
with a consistent colour or shaded background. Select the solid area
pattern and draw an area as the first object. If you draw it so that it
covers the whole page, any future objects can be drawn against this
background. This technique can also be used to give rectangular blocks of
objects-say, all the objects in a column-a different background colour.
3-8
COLOUR PALETTE
The Colour Palette is used to change the colours of objects on screen after
they have been drawn. It allows you to assign a different colour to any of
the 16 colours in the Colour Panel-on the Amiga, this figure varies
according to the resolution (see Chapter 2). Any object that have been
drawn in that colour will be instantly shown in the new colour. (The same
effect can be achieved by changing an object's attributes-see Editing
Attributes in Chapter 4).
Some users may find the Colour Palette facility a little confusing. The
best way to understand it is to think of the Forms editor as providing 16
pens, each with a different coloured ink. The Colour Palette enables you to
change the colour of the ink a pen uses. The total number of available
colours remains the same, but the way they are distributed can be altered.
If you wanted to, you could assign the same colour to all the pens. All the
boxes in the Colour Panel would then contain the same colour.
The procedure for assigning a colour from the Palette is as follows:
1. Click on the Colour Palette icon-the Colour Selection dialog will
appear.
2. Select the colour you want to change by clicking on its box in the
right-hand panel.
3. Select a different colour from the left-hand panel-the colour in the
right-hand panel will then change to the colour you have selected from
the left-hand panel.
4. Click on the OK gadget.
You will notice that any objects (or their backgrounds) drawn in the old
colour are now shown in the colour you have selected. If you want to reset
objects to their initial colours, click on the Reset gadget in the Colour
Selection dialog.
OBJECT PRINT STATUS
This attribute determines whether an object is printed or not. As you will
see when you come to print out a form (Chapter 7), you have the option of
printing all the objects in a form or only certain types of objects. The
Object Print Status further extends the printing options, and allows you to
leave out selected objects, irrespective of what type they are.
When the object print status box is highlighted, any object you select will
not be printed. The default print status for objects is 'on'; that is, an
object is
3-9
printed unless you specify otherwise. If you do not want an object to be
printed, first select the object by double clicking on it and then make
sure that the Print Status box is highlighted.
TEXT STYLES
These attributes set the style in which characters are printed (on screen
and on paper). From left to right, they are:
Normal Bold Underlined Italic
When a style has been selected, its box is highlighted. To select a
particular style click on the appropriate box, and click a second time to
deselect it. Normal cannot be selected at the same time as one of the other
styles, but otherwise you can have any combination of text styles. For
example:
Bold and italic
Bold and underlined
Italic and underlined
Bold, italic and underlined
See also the section on Text fonts, later in this chapter.
FIELD JUSTIFICATION
You use this attribute to specify where the contents of a field will be
placed in the field's box. Field justification only applies when forms are
used with Superbase files.
There are three alternatives. Field data can be left or right justified, or
centered. The justification panel has three compartments. Click in the
appropriate compartment to set the type of justification you want. Any
fields you add to a page will take the current justification attribute. If
you want to change the way a field is justified, first select the field and
then change the justification in the Attributes box.
READ ONLY
The Read Only attribute is represented by the letter R at the right of the
justification panel. You may want to set this attribute when you are
designing a form for data entry. It allows you to specify that the field
you have selected can only be read, and cannot be modified. This means that
you can use the field to display data from a Superbase file, but you will
not be able to enter data in the file through this field. The default
condition is that Read Only is not set, and fields can be both read and
written to.
3-10
Read Only can also be set for calculations.
AREA PATTERNS
Areas can be drawn in any one of the 16 area patterns shown in the area
pattern panel. The default pattern is Solid, shown at the top left-hand
corner of the panel.
You can select a different pattern by clicking on its box. The box will
flash to show that it has been selected and any future areas will then be
drawn in that pattern.
Lines and boxes are also drawn using the current area pattern. This
provides you with a variety of different dotted and broken lines to choose
from. When the Form Editor draws a line, it takes the top line from the
current area pattern. So, if you want to draw a dotted line select box 4;
for a dotted line with fewer dots in it, select box 6; and for a broken,
select box 8.
The fact that lines (and boxes) can be drawn with the current area pattern
means that lines can take two colours. You can see this effect if you
select the Pen and Paper colour mode together with one of the broken or
dotted line patterns.
LINE THICKNESS
Four degrees of line thickness, and two types of line pattern, are
available from the panel at the bottom of the Attributes window. They
determine the thickness of both Line objects and Box objects.
The default line is the one shown in the left-hand box. Click on one of the
other boxes to select a different thickness or pattern.
TEXT FONTS
On Gem versions, text can be displayed in one of three different fonts -
System, Swiss and Dutch-and in a range of different point sizes. (The
Amiga offers a different set of fonts and point sizes.) The point size
determines how high a character is. There are 72 points to the inch, so a
capital letter in 36 point type size will be printed half an inch high,
although it may not be shown in exactly this size on screen.
Note that although you can alter they style of a text object, you cannot
change its font and point size once it has been added to the page.
3-11
CROSSHAIRS
The Crosshairs option provides a drawing aid rather than a tool for
creating objects. It allows you to replace the normal drawing cursor by
crosshairs - that is, two intersecting lines which run horizontally and
vertically across the page window. Used in conjunction with any of the Set
menu options, the crosshairs enable you to line up objects with each other.
Unlike the design tools, the Crosshairs option is selected from the Edit
menu. The menu item acts as a toggle: click once to select Crosshairs,
click again to turn it off.
A line and column counter is provided with the Crosshairs option, allowing
you to see the precise position of any object on the form.
If the Align option is not selected, the counter will show line and column
values in pixels. If Align is switched on, the values will be for
character-based line and column positions.
ALIGN
Like the Crosshairs option, Align is an editing aid rather than a design
tool. It is used to make sure that objects line up with each other on the
page.
Align is either on or off. When it is on, the Forms Editor imposes an
invisible grid on the page. This ensures that any object you add to a page
is aligned with the nearest character boundary. The character boundaries
are worked out according to the standard system font, and form a grid of
lines across the whole page 240 characters wide by 66 characters deep.
Align can also be used to line up objects after they have been added to a
page. First you need to select the objects you want to align (Chapter 4
explains how to select objects). Clicking on Align will then have the
effect of shifting the objects so that they lie on or start from the
nearest character boundaries. The default condition is that Align is off.
Selecting Align from the Edit menu turns it on, and places a tick next to
it on the menu; selecting Align again, turn it off.
3-12
REDUCE
The Reduce menu option scales down the form, bringing the entire 240 column
by 62 row form page into view. This is very useful for checking the overall
layout of the form design.
The reduced view may not be edited. Most of the menu options are disabled
when you select Reduce.
When you are looking at the reduced view, the word Reduce on the Edit menu
is replaced with the word Normal. If you now select Normal, you are
returned to the original display.
3-13
CHAPTER 4 - EDITING FORMS
There are two ways in which you can edit a form. First, you can edit
individual pages, altering the arrangement and appearance of objects on a
page. Second you can change a form's page order.
In this chapter, we describe the options provided for editing a form. We
also introduce two new concepts: the Hierarchy of Objects, and the
Clipboard.
HIERARCHY OF OBJECTS
When you add objects to a page you will notice that some of them are
superimposed on other objects, and some are placed underneath other
objects. The explanation is that objects have a hierarchy-or 'order of
precedence'-that governs which objects are placed on top of these.
The hierarchy is (from lowest to highest):
Areas
Boxes
Lines
Images
Text
Fields
The further down the list an object is, the higher the priority it is
given. Thus, boxes are placed on top of areas, and lines are placed on top
of boxes. If two objects belong to the same category of object, the most
recent object is placed on top of the other. Thus if you draw a series of
overlapping areas, it will look like a pile of papers and the last area
drawn will appear at the top of the pile.
One way of thinking about the hierarchy of objects is to imagine that each
type of object is drawn on a separate sheet of glass. A Forms Editor page
can then be thought of as six sheets of glass superimposed on each other,
with the sheet showing areas at the back and the fields sheet at the front.
There are two reasons why you should try and develop a clear idea of how
the object hierarchy operates. First, it obviously makes a difference to
the appearance of a page, and you will need to bear the hierarchy in mind
as you add new objects. Second, the hierarchy plays a part in determining
how objects are 'selected' (see the next section).
4-1
SELECTING OBJECTS
Some Forms Editor commands only work with objects that have been
'preselected'. In other words, you need to select an object or a group of
objects before carrying out certain operations. These operations are:
Cut
Copy
Replicate
Move (with a group of objects)
Edit attributes
Set print status
You select an object by positioning the pointer over it and double clicking
the left mouse button. The Forms Editor will then show that the object has
been selected by outlining it in black with a broken line.
To select a group of objects, hold the Shift key down and click once on
each object in turn. Click on an object again to deselect it from the
group. If you are selecting a line or a box, you need to place the pointer
on the line or on one of the sides of the box. To select an area it is
sufficient to place the pointer anywhere inside the area.
When you select an object, the Forms Editor follows the object hierarchy
and if two objects occupy the same space it takes the one on top. You might
think this would make it difficult to select underlying objects. But it is
unlikely that you will design a page in which one object is completely
covered up, so you can usually find a part of the underlying object that is
not obscured by anything else.
In order to deselect an object or a group of objects double click on part
of the page that is not occupied by any object.
EDITING A PAGE
Editing a page includes:
Rearranging the objects on a page.
Moving objects to a new position.
Removing objects from the page.
Copying objects.
Resizing objects.
4-2
This section describes the page editing options. Cut, Copy, Paste and Undo
are selected from the Edit menu. Move and Size are on the Set menu. Clear
is on the Page menu.
UNDO
For any operation involving one of the Set menu items, the Undo command
reverses the effect of the last action you carried out. If, for example,
your last action was to draw a box, Undo removes the box from the page; if
you have resized a line, Undo will restore the line to its original length
and position.
Undo also works with operations involving groups of objects. So if you have
Moved several objects together, Undo will return them all to their original
position.
Note that Undo only reverses the effect of Set menu actions. It cannot be
used to remove an object that has been added to the page with the Paste
option.
CLEAR
Clear clears a page, removing all the objects on a page. Use this option
when you want to discard your page design and start again.
Once a page has been cleared, it cannot be restored by using Undo. If you
think you might want to use a page design later, make sure that you save
the page before clearing it.
THE CLIPBOARD
The clipboard is an area on disk that the Forms Editor allocates for
storing objects temporarily. When you Cut or Copy an object, it is placed
on the clipboard. This area, then, has two functions. It acts as a trash
can where you can dispose of unwanted objects, and it also acts as
temporary stopping place for objects which will be later pasted onto a
page.
The clipboard can only hold one object or one selected group of objects at
a time. If there is already an object on the clipboard, using Cut or Copy
replaces the existing object (or objects) with a new one.
CUT
Cut removes selected objects from the screen and stores them on the
clipboard. It is used to remove objects from a page permanently, and it can
also be used in conjunction with Paste to transfer objects to another page.
4-3
To cut an object (or objects), first select it by double clicking on it,
then pull down the Edit menu and click on Cut.
COPY
Copy works in the same way as Cut, except that it copies a selected objects
onto the clipboard, and does not remove objects from the page. You can use
it with Paste to duplicate an object on the page as many times as you like.
It can also copy objects to other pages.
Copy is particularly useful when you are creating a form in which rows and
columns are repeated. Suppose you are building a form for data entry, and
you want each row to have a box where the user keys in data. With Copy, you
only need to draw a box on the first row and you can then use Paste to
repeat it on each successive row.
PASTE
Paste takes whatever is on the clipboard-a single object or a group of
objects - and copies it onto the current page.
To use Paste, first select it from the Edit menu. A dotted rectangle will
then appear on screen, showing where the clipboard objects will be pasted.
By moving the pointer, you can move the rectangle to any position on the
page. When you have decided where you want to place the clipboard objects,
click the left mouse button. The Forms Editor will then draw them on the
page.
Note that if there are no objects on the clipboard, there will be nothing
to paste on the page. Paste only works with objects that have been
previously copied or cut. However it does not remove objects from the
clipboard, so you can paste the same object as many times as you wish.
MOVE
The Move option is used to move any object or group of objects to a new
position on the page.
First you need to select the Move option from the Set menu. Then position
the pointer over an object you wish to move. Click once on the left mouse
button. At this point the object will be outlines with a broken black line
to show that it has been selected, and the pointer will change to the arrow
symbol. You can now move the object to a new position. When you click the
mouse button again, the object will be removed from the old position and
redrawn at the new one.
4-4
MOVING A GROUP OF OBJECTS
Move also operates on objects that have been selected by double clicking on
them. One advantage of using this method is that it allows you to select a
group of objects (either before or after you select the Move option) and
then move all the objects in the group at the same time.
Another advantage is that you can move an object even if the pointer is not
positioned on top of it. You can place the pointer elsewhere on the page
and move the object in the same way as with the first method-by clicking
once and then moving the pointer.
SIZE
The Size option is used to change the size of graphics objects-lines,
boxes, areas and images.
The procedure for resizing an object is as follows:
1. Select Size from the Edit menu.
2. Move the pointer over the object and click the left mouse button.
3. A dotted outline of the object will appear. Moving the pointer will
expand or contract the object from the bottom right-hand corner (or the
rightmost point in the case of a line).
4. Click the mouse button to fix the object at the new size. The top
left-hand corner of an object remains in the same position when you
resize it. But you can reflect the object about this point in either the
x axis or the y axis or both. This means that you can flip an object
over at the same time as making it bigger or smaller.
EDITING ATTRIBUTES
After you have drawn an object, you can go back and change any of the
attributes you have given it. This editing facility applies to text and
graphics objects alike, to single objects or selected groups of objects,
and to new pages or pages that have been loaded from disk.
To change an object's attributes, you first need to select the object. Then
use the attributes window to set the new attributes: simply click on one of
the window options-line thickness, colour, pattern, text style (for text),
etc-and the object will instantly take on the new attribute.
4-5
To see how straightforward the process is, try this example:
1. Select Area from the Edit menu and, without setting any attributes
beforehand, draw an area. If you have just loaded the Forms Editor, the
area will be drawn in a solid black pattern.
2. Select the object you have just drawn by double clicking on it. You can
now open the attributes window and start changing the area's attributes.
3. Change the area's pattern, simply by clicking on another pattern in the
panel.
4. Change the foreground colour using the Pen and Paper colour selector.
5. Click on the Pen and Paper icon to change the colour using Pen and Paper
colour selector.
EDITING TEXT
Chapter 3 explains how to use the cursor keys to edit text while you are
typing it in. In the same way, you can also edit text after it has been
fixed on the page.
To use this facility, you first need to select Text from the Set menu. Then
position the cursor over a lien of text (an existing text object) and click
once. When you do this, the Forms Editor will draw a dotted line around the
text line and place the cursor at the front of it. You can now edit the
line-you can change its characters, delete them, or add new
characters-using the cursor keys, the Del key and the Backspace key.
In allowing you to edit existing objects. Text operates in a different way
to the other design tools. Unlike Line, Box, Area and Image, the Text
option does not allow you to superimpose one object over another. You might
want to do this in order to create a 3D effect with a heading, for example.
The solution here is to use Copy to copy the text line to the clipboard,
then use Paste to superimpose it.
CHANGING PAGES
The order in which pages are placed in a form is not fixed. You can
rearrange them in any order you wish. Three options on the Page menu are
provided for this purpose: To Front, Swap >, and Swap < Using these with
Erase and Open Page (See Chapter 2) gives you complete control over the way
pages are put together
4-6
to make forms.
TO FRONT
This option makes the current page the first page in the form. For example,
if Page 5 is the current page, selecting To front makes it Page 1. The
previous Page 1 will now become Page 2.
SWAP >
This option swaps the current page with the page after it. Thus if Page 1
is current, it will become Page 2, and Page 2 will become Page 1.
SWAP <
This option swaps the current page with the page before it. Page 4, for
example, would become Page 3, and vice versa.
ERASE
Erase deletes the current page from the form. At the same time, it closes
up the remaining pages and adjusts their page numbers.
4-7
CHAPTER 5 - FORMS, FIELDS AND FILES
This chapter explains how to design the forms you will use with your
database files. Field and Calculation are the two options which establish
links between a Superbase file and a form; Validation and Order work with
fields and calculations once they have been added to a page; if a form
contains fields from more than one file, Link can be used to establish
links between the files. All five options are selected from the Set menu.
CALCULATION
Calculations can be regarded as special types of fields. They have the same
function as calculated fields in a Superbase file (see Chapter 2, Volume
1). The differences are that the calculations in a form are not directly
attached to fields, but stand as objects in their own right; and, unlike
fields, they are not stored in Superbase files and only exist in a form. In
every other respect, a calculation can be treated as the same type of
object as a field.
To add a calculation to a form, select the Calculation option from the Set
menu- this option will only be available if a file has been opened. You
will then be presented with the field options dialog. Set this in the same
way as for fields.
Now move the cursor to the position on the page where you wish the
calculation to be added. When you click the mouse button, the Forms Editor
will display a dialog for the calculation name. Type in a name for the
calculation and click on OK.
The name allows you to refer to the calculation in other calculations. The
rules for creating calculation names are the same as the rules for variable
names, as set out in Chapter 2 in the DML Reference Guide. Within the
limits specified, you can enter any name you like, but it is sensible to
choose a name which indicates the calculation's purpose. For example, if
you were defining a calculation to show the total for a column of numeric
fields, you might name it Subtotal1.
After entering the name, the next step is to enter a formula for the
calculation. Superbase will present you with a formula dialog. This is the
same as the dialog which is used for creating calculation formulas in a
file definition. See Chapter 2, Volume 1, for a full explanation of how to
create a formula.
5-1
The formula you attach to a calculation in a form may refer to fields in
any of the open files even if they are not shown on the form (at least one
other field from the same file must be present as an object in the form).
It may also refer to other calculations. In addition, you can create
formulas using the system variables NOW and TODAY.
In the Forms Editor, only the name of the calculation will be shown on the
page. When the form is used in Superbase, the result of the formula will be
calculated and displayed in place of the name.
USING REPORT FUNCTIONS IN CALCULATIONS
If you are designing a form such as an invoice, which requires a
transactional structure in which a field (or more probably a group of
fields) is to be repeated down the page, you are likely to need a way of
performing calculations, such as totalling, on one or more of the fields.
Ordinary calculation syntax does not allow you to do this, as each of the
fields to be totalled has the same name. A calculation like this:
amount + amount + amount
is meaningless.
The Forms Editor allows you to use the special Report Functions to achieve
the required results. So to produce a total for a field called Amount which
occurred perhaps 20 times on a form, all you would have to do is type in a
calculation like this:
SUM Amount
Notice that the calculation operates on all the replicated occurrences of
the field that follows it. The keyword can be followed by only one field
name, and complex expressions are not allowed.
The other Report functions likewise operate on all the occurrences of the
fields that they refer to. The Functions are:
SUM MEAN SD (standard deviation)
MAX MIN VAR (variance)
Each of these functions provides a rolling result, which is updated in the
same way as any other calculation, as you enter or edit data.
Since the Report Functions are used in calculations which have their own
names, they can be indirectly used in other calculations on the form.
5-2
VALIDATION
The Validation option works in the same way as it does in Superbase
Professional when it is used in a file definition. It allows you to assign
a validation formula to a field. The formula sets the limits to what you
can enter in the field.
To assign a validation formula to a field, first position the cursor over
the field. When you select Validation from the Set menu, you will be
presented with a Validation dialog. You can then create the formula by
making selections from the dialog. The exact procedure for creating a
validation formula is explained in Volume 1, Chapter 2.
REPLICATING FIELDS
With some applications, you will want to repeat the same field at different
points on the page. One way of doing this is to repeat the fields selection
procedure each time you add the field. However, an easier way is to use the
Replicate option from the Edit menu. This option allows you to repeat a
field as many times as you wish, in one go.
First select the field you want to replicate by double clicking on it, and
then select Replicate. This action calls up a dialog where you can enter
the number of repetitions required. Type in the number and click on OK.
Starting from the line below the first occurrence of the field, the Forms
Editor will then replicate the field the specified number of times.
Replicate can also be used with calculations.
SETTING THE FIELD ORDER
The Order option allows you to define the order in which data is entered
into fields. You can use it when you are designing forms for data input to
Superbase files.
By default the field order is the order in which you add fields to a form.
For example, if you add a Firstname field before a Lastname field, users
will be required to type in their first names before typing their last
names. Using the Order option, you can instruct the Forms Editor only to
accept data in the order you specify, irrespective of how the fields were
added to a page and where they are positioned on the page. The field order
applies to all the fields in a
5-3
form, so you can also define an order which extends over more than one
page. When you select Order, you are first presented with a dialog which
gives you a choice of resetting the current order or leaving it as it is.
If you select Reset, the fields are numbered from left to right on the same
line, then line by line, and page by page:
FIELD1 FIELD2 FIELD3
FIELD4 FIELD5 FIELD6
FIELD7 FIELD8 FIELD9
When you have clicked on OK or Cancel in the dialog, the Forms Editor
displays the field order on screen using an order number for each field.
You can now define a new order by clicking in field boxes. The rules for
setting a field's order number are:
With your first action, select a field as the current field by clicking in
it once.
Thereafter, click once in a field to make it the next field in the order
sequence. The field you click in then becomes the current field. Click
twice (but do not double click) to take a field to the top of the list-to
make it the first field.
This may seem a little complicated. In practice, though, the procedure is
straightforward. You first select the field you want to start from;
clicking once in this field makes it the current field and does not reset
its order number. Then you define the order for the remaining fields by
clicking in each field once.
We can illustrate by taking the field order shown above as an example.
Suppose the first three fields you clicked on were Field2, Field5, and
Field9. The new field order would then become:
FIELD1 FIELD2 FIELD5
FIELD6 FIELD3 FIELD7
FIELD8 FIELD9 FIELD4
After the first click, clicking on a field automatically changes its order
number and, at the same time, makes it the current field. If you want to
select a field without changing its number, go back to the Set menu and
select Order; then click on Cancel and start again.
Note that even if one field is only slightly higher on the page than
another, the Forms Editor will regard it as being on a different line.
When you reset the field order the field on the higher line will be placed
before the field on the line below, despite the fact that it may appear to
be on the same line,
5-4
and may be positioned further to the right.
LINKING FILES
The Set Link option is used to establish the relationships between the
files associated with a form, so that Superbase can retrieve the correct
sets of records when you browse through multiple file forms.
Link works like a relational query. There must be a point of contact is a
field which has the same content in both files, such as an account number,
a part code, or an invoice number. As in Query, you must set a
relationship of equality between these two fields, which Superbase can use
as a way of looking up the right records.
When your form includes fields from only one file, there is no need to set
a link. Only when there are two or more files do you need to use the
option. The Forms Editor will let you save a form that uses multiple files
without setting links for all the files, but the files will be displayed
independently.
USING THE LINK OPTION
When you select Set Link, the Forms Editor displays a dialog box which you
use to select the fields to be linked.
At the top is a file name, with a file selector button next to it. You
click on this button to cycle through the open files. The fields for each
file are displayed in the field name panel below the file name.
Below the field name panel are two selection boxes. These will contain the
names of the two fields that you link. To the right of the selection boxes
is a Set button. This is used to confirm the selections.
A TWO FILE EXAMPLE
Suppose you have designed a form to show a summary of deposit details for
each client. You must establish a link between the Deposits file and the
Clients file. This would take the form of the client's last name, which is
included in every deposit record. So the link would have this structure:
lastname.CLIENTS=lastname.DEPOSITS
In this case, the Clients file is said to be the Master file in the link,
as you would normally want to browse through the forms in Client order,
retrieving a group of deposits for each client. The Deposits file is then
referred to as the Secondary file in the link.
5-5
In the Set Link dialog, the message at the top of the panel acts as a
prompt, so that you can see at a glance which part of the operation you are
doing. When you first select the option, the message reads "Set master link
field". The field you click on now will be designated as the link field in
the master file. In our example, you would first select the Clients file,
then click on the Lastname field. The Forms Editor would then place
Lastname in the upper selection box, which has a highlighted pointer next
to it indicating that it is active. You can change the field in the box by
clicking on another field. When you're ready, click on Set to confirm your
selection.
After you have selected a field for the upper box, the message at the top
of the dialog changes to "Set secondary link field". You must now select a
field from the other file, in our example the Lastname field from the
Deposits file. Notice that once you have selected a field from the master
file, you cannot select the secondary link field from the same file, as the
Forms Editor automatically removes it from the list of available files.
Once you have chosen the two fields that form the link, their names will
appear in the two selection boxes:
Lastname.CLIENTS
Lastname.DEPOSITS
Now you confirm the link by clicking on Set. If there are only two files to
be linked, you can then exit by clicking on OK. The Forms Editor will store
the link information with the '.sbv' file, and also in the program file
that is generated when you create a report form.
LINKING MORE THAN TWO FILES
Many applications will use forms which include fields from three or more
files. There can be only one master file. In every other link, the file
from which the field name is chosen for the upper selection box is called
the Primary file; the other file is still called the Secondary file.
The messages at the top of the dialog box always indicate whether you are
selecting a field from a master, a primary, or a secondary file. The Forms
Editor automatically makes the correct set of files available for
selection, depending on which part of the operation you are performing.
When you are setting links for more than two files, you must first set the
master file link. After clicking on Set to confirm your selections, you
repeat
5-6
the operation for the next pair of files, and so on until all files have
been linked up.
EDITING EXISTING LINKS
Sometimes you may need to change links that you have already set up. The
main thing to remember is that changing the link structure at any point
causes all the subsequent links to be cleared, so you will have to set them
up again. Clearing the links like this is a necessary precaution against
ending up with an invalid structure.
When you select Set Link you will see the Master/Secondary link fields
displayed, with the upper field pointer highlighted. You can select any
field to replace the master file link field, or click on Clear to empty the
selection box. Any action which makes a change clears all the subsequent
link details. Click on Set to confirm new or existing selections, and to
move on to the following links. If the current selection box is empty,
clicking on Set has no effect. If you continue to click on Set, you will
cycle back through the structure.
LIMITS OF THE LINKING CAPABILITY
Although the ability to set links between files provides the system
designer with a powerful tool for creating applications, there is a limit
to the complexity of the forms which the data base can handle
automatically. In particular, you cannot set up forms where a transaction,
defined as a repeating group of fields in a form, has further transactions
of its own. In our example, each deposit is a transaction, so each deposit
may only be linked to another file on a one to one basis-you could look up
some bank details from the Accounts file, for example.
But consider an invoicing application where three files are linked
together: a customers file, an invoices file, and an invoice order lines
file. Here we can set up links to retrieve the invoices for each customer,
or the order lines for each invoice, structures which look like this:
CUSTOMER DATA INVOICE DATA
Invoice 1 data Order line 1 data
Invoice 2 data Order line 2 data
Invoice 3 data Order line 3 data
5-7
However, we cannot set up a form which will automatically retrieve both the
invoices for each customer and the order lines for each invoice, a
structure like this:
Customer data
Invoice 1 data
Order line 1.1 data
Order line 1.2 data
Invoice 2 data
Order line 2.1 data
Order line 2.2 data
However, having indicated the restrictions, we must point out that since
Superbase is a programmable database, anything is possible, and forms of
far greater complexity than the one above can be set up and processed
easily by Superbase programs.
For further information on Forms and how they are used from within the
database itself, see Chapter 8, Using Forms and Reports, in this Volume.
5-8
CHAPTER 6 - PRINTING FORMS
This chapter explains how to use Print, the Forms Editor's printing
facility. With this option you can create a 'hard copy' version of a page
that looks almost exactly the same as it does on the screen. You can also
specify exactly what is to be included in a printout and what is to be left
out. If you wish, you can omit all the objects of a specified type, or you
can leave out just one or two selected objects of different types.
The quality of a printed form will depend on the type of printer used. But
even if you are using a low-cost dot matrix printer, you will still be able
to print forms that are suitable for most of your business requirements.
When a laser printer is used, the Forms Editor's output approaches the
quality of printed material produced by traditional typesetting methods.
PRINTING A PAGE
The Print option works with the current Forms Editor page and prints a
third of the page at a time. Each of the three parts of a page is referred
to here as a print zone. Remember that a page is 240 characters wide and 66
lines deep. A print zone is therefore the size of a single A4 sheet of
paper, 80 characters wide by 66 lines deep.
The procedure for printing a page is as follows:
1. Make sure that your printer is on line.
2. Select Print from the Project menu. You will then be presented with a
dialog, which allows you to set various print options (see the next
section), including the print zone.
3. Set the print options, and click on OK.
To print a multi-page form or to print more than one print zone in a page,
you need to repeat this process for each page and each zone.
PRINT OPTIONS
The Forms Editor provides two print modes, Draft and Graphics. To select
one of these two, click on the appropriate box in the Print dialog.
6-1
DRAFT PRINTING
In Draft mode, the Forms Editor only prints the text on a page, using the
printer's standard font. When you are designing a form, you could use this
mode to get a rough idea of what the page layout looks like.
There are many circumstances where it is not necessary to print record data
in 'letter quality' or 'near letter quality' print. But at the same time
you might want to improve the presentation of the data by using a standard
form in which it is neatly laid out with boxes, lines, heading, titles, and
so on. To do this, would first design your standard form, taking advantage
of all the Forms Editor's graphics and text facilities; you would also
specify which fields are to be included on the form.
The next step is to photocopy or print out multiple copies of the form, and
feed them back into the printer. If you the use the form in Superbase to
extract the data, you will be able to print the data on the photocopy of
the standard form, in the fields you have specified.
GRAPHICS PRINTING
In the Graphic print mode, the Forms Editor produces a hard copy version of
a page, which matches the appearance of the page on screen. Graphics
objects are copied to the printer with the same attributes as they have on
screen (except colour-see below); and text objects are printed in the same
font, in the same point size and with the same text style.
In addition, Graphics mode allows you to select which types of object you
want to print. This means you can omit certain types of objects from the
printout of a page. For example, you could instruct the Forms Editor to
leave out fields, or only to print text.
The print dialog provides a selection box for each of the six types of
objects. If you want to print an exact copy of the screen, you need to
click in all the boxes. When you select a particular type of object for
printing, its box is highlighted; clicking a second time deselects the
object and turns the highlight off.
Obviously, you will not be able to represent the colours you see on screen
on the printer, unless you have a colour printer. Any colours other than
white are printed as black.
6-2
PRINT ZONES
Most applications do not require forms that are wider than 80 columns, so
generally you will find that you only use the left-hand print zone.
However, you may want to create a wide form which runs across two or three
A4 sheets. In this case, you will need to specify which sheet you want
printed, using the print zone selector in the print options dialog.
The print zone selector is divided into three compartments. By default, the
Forms Editor prints the left hand zone. To print the middle zone or the
right hand zone, slide the box along to the corresponding compartment in
the print zone dialog.
OBJECT PRINT STATUS
The section on Attributes in Chapter 3 explains how to set an object's
print status. This attribute gives you a further choice over whether an
object is printed or not. Provided you have selected a type of object for
printing, the default condition is that all the objects belonging to this
type are printed. But by setting the object print status you can specify
that particular objects within an object type are omitted from your hard
copy version of a page.
6-3
CHAPTER 7 - GENERATING REPORTS
In addition to its functions as a form design package and a screen painting
tool, the Forms Editor can be used as am effective generator of reports to
be used with Superbase databases.
As far as the Forms Editor is concerned, a Report is a special kind of
form. If you are working on an existing ordinary form, the Forms Editor
does not allow you to use the Report menu. Only when you select Project New
or load an existing Report form are the facilities of the Report menu made
available. This is also true for the Set Function option.
When you save a Report Form, the Forms Editor creates the usual '.sbv' file
which holds a definition of the structure and appearance of the form you've
designed. But as a Report is being created, the Forms Editor creates an
additional disk file, which is a Superbase program file, extension '.sbp'.
This is a Superbase program that you can either run unmodified from within
Superbase, or edit with the Program Editor to add your own special extras.
OVERVIEW
First you use Project New to clear the Forms Editor. Then you open a file
to enable the Report Menu. Then you use the Report menu options to create
the report structure. Each one generates a box on the screen, which defines
a section of the report, such as the heading. You just select the fields
you want and position them as you require, adding text for column and group
headings and so on. When you've finished you save the form in the usual
way. To use the report you first load Superbase, then either open the
report as a form or run the report program.
A NOTE ON GRAPHICS AND TEXT
Reports generated with the Forms Editor for use with Superbase are
straightforward ASCII output. You cannot include areas of colour, patterns,
or lines, nor can you print out images. Text will always appear in the
usual system font. (You can vary the colour of the text on screen, but it
won't print in colour). You can specify that any text item is underlines,
italic, or boldface, and the report will appear like that provided the
printer supports the feature.
7-1
You can of course design the stationery on which the report is to appear
with the Forms Editor.
CREATING A REPORT: STEP BY STEP
PREPARATION
Select Project New Form. Open at least one of the files you will be using
in the report. This enables the options on the Report menu, and the Set
Function option. It also disables options not available for reports.
You may need to set up field links if you open and use more than one file.
SELECTING FIELDS TO BE PRINTED
Choose the Report Select menu option. The Forms Editor places a box on the
screen, with the word SELECT at the top. The default dimensions of the box
are three lines by 240 columns. The 240 column right-hand edge of the box
can be disregarded, as Superbase will follow the current printer settings
when actually printing the report.
Now use Set Field in the normal way to place fields from one or more files
inside the SELECT box. Use Move or Size to change the position or
dimensions of a field. The position of a field in the box determines where
it will be printed on the paper.
You can also use Set Calculation to place a derived field expression in the
SELECT box, and Set Text to add specific text messages.
Whatever you place inside the SELECT Box becomes the body of the report,
and will be printed out on every repeated line.
SPECIFYING A REPORT HEADING
Choose the Report heading menu option. This specifies the text that will be
printed at the top of every page of the report. The Forms Editor places a
box at the top of the screen with the word HEADING in the top line. Resize
the box if you want a larger area.
Now type in the text you want for the report heading. You are limited to
the standard system font, and the characters available on the normal
keyboard. If you want the system date or time to appear in the heading, you
must treat them as calculations, placing them in the HEADING box with the
Set Calculation option. The same applies to the page number. The relevant
system variables, which should be entered as single keywords, are TODAY,
NOW, and PG; you can assign
7-2
the calculations any dummy names, as names are not used in the report.
The HEADING box should also include any column headings, since reports
generated from the Forms Editor (as opposed to the Superbase Query
function) do not use field names as automatic column labels.
SPECIFYING A REPORT FOOTING
Choose the Report Footing menu option. This specifies the text that will be
printed at the foot of each page of the report. The Forms Editor adds a box
with the word FOOTING in the top line. Extend it if you wish.
Now add any required text items; you may prefer to place the page number in
the FOOTING box rather than the HEADING box.
A report consisting of a heading, a footing, and a line of fields is about
the simplest type of report there is. You could save your Report Form at
this stage and use it effectively from within Superbase. But if you want to
achieve a more elaborate report structure, including subtotals and other
calculations, you must add further sections to the form before saving it.
GROUPS
For a fuller discussion of the concept of groups in a report, see Volume
One, chapter 11. A group is essentially a way of providing a structure for
a report. Reports can have no groups, one group, or many groups. When a
report has several groups, it helps to think of each one as a level. For
example, if we were to produce a report of addresses in which a subtotal
was produced for every change of city, county and country, the report would
have three levels.
In the Forms Editor report generator, you can specify any number of report
groups or levels.
SPECIFYING A GROUP
Choose the Group option from the Report menu. The Forms Editor presents you
with a dialog from which you must select a field name. This will be the
field on which the report is grouped. When you click on OK, the Forms
Editor inserts two boxes into the report structure, on either side of the
SELECT box. These are the BEFORE GROUP box and the AFTER GROUP box. They
have the same field name in the top line so you can tell at a glance that
they are related.
7-3
THE BEFORE GROUP BOX
The BEFORE GROUP box contains text and data that you want to appear on
every change of group. You can include field names that do not appear in
the SELECT box. This is the way to produce reports that follow a
transactional structure:
Customer number, customer name
Order number, Order date, Order amount
Order number, Order date, Order amount
Customer number, customer name
Order number, Order date, Order amount
Order number, Order date, Order amount
Customer number, customer name
Order number, Order date, Order amount
Order number, Order date, Order amount
Order number, Order date, Order amount
Here, the Customer data is placed in a BEFORE GROUP box for the Customer
name or account number, and the Transaction data appears as a group of
fields in the SELECT box.
THE AFTER GROUP BOX
In this box you can place the usual text and field data, but you can also
include special reporting functions to produce subtotals, etc. Every time
the group changes, the AFTER GROUP box will be acted on.
If you want to make use of the special reporting functions, you must select
them with the Set Function menu option, which works in a similar way to the
Set Field or Calculation options. Select Set Function, then click where you
want the function to appear. You can only place functions in the AFTER
GROUP or AFTER REPORT boxes. When the Set function dialog appears, click on
one of the function buttons. The keyword is copied into the Selection box.
Now select a field name to follow it. Only select one field - you can't
have more than one item printed in the same place place. Click on OK, and
the Forms Editor places a field in the AFTER GROUP box, at the point where
you clicked. It's up to you to identify what the field is for by, for
example, typing some text next to it.
Repeat this operation for each special function you want printed out for
each group.
If you want to refer to the contents of the Group field that has just
registered a change use the GROUP keyword, for example:
7-4
LAST GROUP WAS FOR: GROUP
This should be entered as a calculation with a dummy name.
MULTIPLE GROUPS
If your report requires several groups or levels, you must select Report
Group and set up a BEFORE GROUP and an AFTER GROUP box for each one. The
Forms Editor automatically inserts each new pair of group boxes on either
side of the SELECT box. This has the effect of determining the sorting
order for the report, so you should really set up the groups in order from
largest to smallest.
SPECIFYING REPORT FUNCTIONS
There is a sense in which the report can be treated as a single group. This
is necessary if you want to obtain totals, etc., for the report as a whole.
Select the Report Report menu option. The Forms Editor creates two further
boxes, with the words BEFORE REPORT and AFTER REPORT in their top lines. In
the BEFORE REPORT box you should place any text you want to appear before
the report proper starts, such as a note to the reader.
In the AFTER REPORT box you should place any text items, fields, and
special Report Functions that you want to appear after all the records for
the report have been printed. Choose all these items exactly as you would
do for a Group, as described above.
THE REPORT FILTER
A report filter line is generated automatically when necessary, and placed
in the Superbase report program, as the WHERE part of the program's SELECT
statement.
The WHERE line contains only the information needed to relate files
together when more than one file has been used in a report. The information
is taken from the field links that you must set before you can save the
report form. If only one file has been used, no WHERE line is created.
When you run the report program from within Superbase itself, the program
displays a filter dialog, so you can add extra conditions to the
automatically generated filter line for use at runtime.
You can easily make these temporary extra conditions permanent by editing
the report program and saving it, under a separate name if you prefer.
7-5
SORTING
A default sorting order for the report is generated automatically when
necessary. The Forms Editor derives this from the sequence of Groups in the
report structure, and builds an ORDER line, which is placed in the
Superbase report program. If no group is specified in the report structure,
the ORDER line includes the name of the first field in the SELECT box.
As with the Filter, when you run the report program from within Superbase,
you will be asked whether you wish to add any extra fields to the ORDER
line. You might wish to sort within the records by date or amount, without
actually specifying a group for such fields.
All the fields used for sorting the report are sorted in ascending order.
If you wish to change this you can alter the ORDER line when it is
presented at runtime.
SAVING THE REPORT FORM
When you have specified all the elements of the report form, save it in the
usual way, using Project Save. The Forms Editor generates the two files
that the system will need to allow you to execute the report or load it
again into the Forms Editor for modification.
REFINING YOUR REPORT
You can add certain extra features to your report to enhance its appearance
and usefulness.
TITLE PAGE
If you want to print a separate title page, select the Page before Report
option. Anything that is in the BEFORE REPORT box will be printed before
the report proper begins.
TOTALS PAGE
Select the Page before Totals if you want the report to print the report
totals on a separate page.
SUMMARY REPORTS
Select the Summarize option from the Report Options, and the report will
omit the detail normally printed from the SELECT box.
7-6
PAGE ON GROUP
You can force the report to eject a new page after any group. Select this
option from Report Options, and click on the required fieldname. The Forms
Editor places the word EJECT in the top line of the relevant AFTER GROUP
box. This option works as a toggle, so to switch it off go through the
actions again for the same group.
7-7
CHAPTER 8 - USING FORMS AND REPORTS
Using Superbase forms, you can set up quite complex applications involving
multiple files, and perform many standard data processing activities
without having to do any programming.
Forms are intended to be used in three main ways: for browsing through
files, for entering data into files, and as structures for reporting.
Report forms are different from other forms. When you open a report form
from within the database what you see is not the form but its output. This
is because a report form is only a way of generating a report program.
Opening the report form causes Superbase to execute the program.
There are limits to what can be achieved without programming. You can use
forms to create and retrieve records, but if you require a very complex
file structure in which files and records are cross-linked in variable
ways, you may find that you need to program Superbase to achieve your
objectives. Even so, the programming language itself is designed to reduce
the time needed for creating applications, and you can use many of the
built-in facilities of the forms to speed development up still more.
OPENING A FORM
Select the Project Open Form option. Superbase presents you with a list of
all the forms available in the current directory. Open the one you require
by double clicking on its name or by clicking on its name and then on OK.
The act of opening a form opens all the files associated with the form.
Each file is indexed on its primary index, and the name of the master file
in the form structure is shown in the window title bar.
Any files already open that are not required by the form are closed. You
can reopen a file if you wish provided sufficient memory is available.
SINGLE FILE FORMS
A form that includes fields from just one file is easy to understand and
use. You work with it exactly as you do with the default Form View. All the
browsing activities selected from the Control Panel function in the same
way. You can switch to another index at any time to view or look up records
in a different
8-1
order. Data entry is the done in the same way, except that the fields shown
on the form are the only ones available.
MULTIPLE FILE FORMS
When the fields on the form are drawn from more than one file, the
situation is more complex. It's important to understand the relationships
between the different files, and the assumptions that Superbase makes when
processing multiple file forms.
All the files from which one or more fields are on the form are drawn are
linked together into a logical structure which ensures that records are
retrieved coherently. This structure is created with the Set Link option in
the Superbase Forms Editor.
Every multiple file form has a master file. This is the file whose name is
displayed in the window title bar, and its index is the first index set up
for the file. The master file determines the order in which data is
retrieved when you step through the form using the control panel buttons.
It is possible to select another file as a temporary master file, but the
underlying structure remains fixed, unless you change it from within the
Forms Editor.
Files which are not the master file are tied into the structure with a
field link. This works like a relational join in a query. For example, the
demonstration Clients file could serve as a master file for a form designed
to show details of several deposits. The Deposits file would be linked to
it through the Last name field: Lastname.CLIENTS=Lastname.DEPOSITS. Then
you could step through the Clients records, and Superbase would
automatically retrieve and display the associated Deposits records.
If there are more than two files associated with a form, a similar
relational link must be set up for each one in the Forms Editor so that
Superbase can retrieve records correctly.
BROWSING WITH A FORM
Most of the browsing activities carried out with the control panel buttons
work in the same way as for the default views. You can select the first,
last, next, or previous record in the master file by clicking on the
appropriate button. If there are fields to be found in other files
Superbase will find and display them automatically. There may sometimes be
a short delay if the form structure is especially complex with many files
involved.
The Fast Forward and Rewind buttons scan through the master file one record
at a time, retrieving records from other files where necessary. The Pause
button or
8-2
the space bar interrupts the process, and the Stop button ends it.
CURRENT RECORD/PAGE SELECTOR
The current record button has a dual function. If the form is not
displayed, perhaps because you have selected a menu option such as System
Status File, which temporarily overwrites the screen display, clicking on
the current record button simply redisplays the form.
The button works the same way if your form has only one page. However, if
you have a multi-page form, the current record button functions as a page
selector. The button has two triangles, on pointing up and one down.
Clicking on the left-hand button displays the previous page of the form,
unless you are already on the first page. Conversely, clicking on the
right-hand button displays the next page of the form, unless you are
already on the last page.
CHANGE INDEX
If you wish to view the data in a different order from the default, select
the Project Open Index option and choose the required key field. Superbase
indicates the change by showing it in the window title bar. The browsing
controls will now select records from the master file according to the new
index.
Records from associated files are still retrieved according to the link
structure.
TEMPORARILY CHANGING THE MASTER FILE
You may wish to view forms in an order determined by a file which is not
the master file. For example, it is equally valid to browse through
invoices by invoice number or by customer, but the data for invoices and
customers would normally be held in separate files.
You can switch to any of the files used by the form by selecting Project
Open File. The message in the window title bar shows the name of the opened
file, and is current index, which you may change if you wish (see above).
Browsing operations will select records according to the sequence of the
open file and index, but the records associated with each form will of
course be retrieved according to the form's logical links.
8-3
LOOKUP
You can use the Record Lookup button to retrieve a record in the master
file, either the default master file or one you have set as described
above. The easiest way to think of this is to realize that your lookup will
be for the index and file named in the window title bar.
Superbase retrieves the required record, or the one nearest to it in key
value, and displays all the associated records according to the form's
logical links. Note that Lookup overrides the constraints on browsing set
by Filters (see below).
FILTERS
The Filter button calls up a filter dialog for the current file. Filters
play an important part in browsing. You can set up complex conditions for
any of the files used by the form, to restrict the display to the set of
records you wish to view. These conditions can be based on text, date,
numeric or time values, any type of field, and can include complex
expressions involving Superbase's DML functions. See Volume One for further
details of how to set up Filters.
Each file used by the form can have its own filter. A Filter Command Line
should not refer to fields in other files, as in the browsing situation
this always creates an implicit relational join between the files, which
can cause the system to enter an infinite logical loop while attempting to
satisfy an impossible condition.
Normally, Filter Command Lines are not saved, as the presumption is that
the user will want to be able to enter a variety of search conditions at
any time. However, you can use the function key facilities to store and set
Filter Command Lines for any file. This is done with the SELECT WHERE
command, which creates a filter for the current file. So a typical function
key line would be:
SELECT WHERE FILE "clients" Lastname LIKE "[a-3]*"
Now all you have to do is press the appropriate function key and the filter
will be set for that file. For further details see the section on Function
Keys elsewhere in this volume.
SWITCHING TO THE DEFAULT VIEWS
If you wish to use one of Superbase's default views, Record View, Table
View, or Form View, you may do so without closing the form.
8-4
Pull down the Set menu and select the view you want. The form display is
switched off, and the selected view display takes its place. All browsing
and menu options will operate on the file without reference to the form.
When you select a view, it will normally be for the file that was acting as
the master file for the form display. However, it is possible to open a
file from the Project menu, and work with that instead. The form is not
affected by this, and when you return to the form the form's master file
will be automatically reopened.
RESELECTING THE FORM
To return to a form from one of the default views, pull down the Set menu
and select the View option which has a checkmark against it, i.e. the one
you have been using. This action deselects the option, and redisplays the
form.
If you have been browsing through the master file in one of the default
views, you will find that the form display now reflects the changed master
record.
DATA ENTRY AND EDITING
When a form is open, the Record menu options apply to the form as a whole
rather than to a single file. This means that, for example, if your form
uses fields from several different files, Record Save will create records
for all those files.
There are limits to this very powerful capability, in particular to the
type of form in which there are repeated groups of fields for a file.
Superbase does not allow such a group of fields to have its own subgroup.
To permit it would oblige the system to be able to edit and process
multiple levels of transactions automatically: users with such a
requirement must be prepared to program it directly.
This issue is also discussed in the Forms Editor guide, in the section on
setting links for the form.
FIELD ENTRY ORDER
In the Forms Editor you can specify the order in which data can be entered
into the form. This would allow you, for example, to enter some data in the
top right- hand corner first, then move down a column of figures in the
centre of the form, then finish off in the top left-hand corner-using only
the Return key at the end of each entry to move from one field to the next.
Return moves the cursor to the next field in the entry order, Control
Return
8-5
(Shift Return on the Amiga) moves the cursor to the previous field in the
entry order.
You can override the entry order by positioning the mouse pointer in any
field and clicking to obtain a cursor. Then entry order will be resumed at
that point when you press Return or Control Return.
The entry order can only be changed from within the Forms Editor.
DATA ENTRY: RECORD NEW
When you want to enter data into the open form, select the Record New menu
option. Superbase presents a form with all fields empty, and the cursor
positioned in the first field specified in the entry order.
Start entering data. Superbase performs validations and calculations on the
data as you work, in the same way as for single file data entry done
without a form.
You can switch from page to page with the Page Selector button, or follow
the data entry order, or use the mouse to select any field directly.
COMMITTING THE FORM: RECORD SAVE
After you have entered all the required data into the form, you can choose
any of the three standard ways of saving:
Alt-S (Amiga S)
Record Save menu option
Double click of the mouse (must not be in a field)
The third option asks you for confirmation before proceeding.
When Superbase saves data from a form, it uses the structure of the form to
work out how many records to create, and which files to create them in.
If your form has fields from only one file, saving the form will create
only one record. Any fields that are present in the file definition but not
on the form will be left empty. If such a field is a key field, an entry in
the appropriate index will be made, consisting of spaces.
It is up to the form designer to ensure that the act of saving the form
does not create any validation or required field conflicts for fields that
do not appear on the form.
If the form includes fields from multiple files, and each field appears
only once on the form, saving the form will create one record in each file,
unless the program detects that the data has not changed or that there is
no data.
8-6
If any of the fields on the form appear more than once, saving the form
will create the same number of records in that field's file as there are
occurrences of the field. So if you had ten order lines on any invoice
form, each consisting of the fields Quantity, Description, Price, Discount
and Total, saving the form would result in ten new records in the order
lines file.
The fields saved could include not only those actually visible on the form
and entered manually, but also fields that do not appear on the form, such
as a key field generated by a formula to link the orders to the invoice
header.
When Superbase has saved all the records required by the form's structure,
it presents you with another blank form. If you don't want to enter any
more data, any other action will cancel the data entry process.
BATCH DATA ENTRY
The process of saving records for a complex form can take an appreciable
time, especially on a floppy disk system. Careful system design can reduce
this, and by selecting Record Batch you can make use of available RAM to
cut down the delay between saving a form and starting the next.
EDITING A FORM
You do not have to select any menu option to begin editing a form. Simply
point at the field you wish to alter and click in it.
When you have finished editing, save the form in one of the ways described
above. Superbase will only replace records to which you have made changes.
You can make changes to any of the fields in the form, arriving at the
field you wish to change either by following the entry order through
pressing Return or by clicking in the field with the mouse. The Page
Selector button is also available.
If you select the Record Edit menu option. Superbase displays the current
record in the current master file, and any associated records, and places
the cursor in the first field in the entry order. You would usually only
use this menu option to be sure of selecting the current record after an
earlier action had obscured the normal screen display of the form.
SNAPSHOT DATA ENTRY: RECORD DUPLICATE
This option allows you to use the data in one form as the basis for
another, cutting out the need to retype items that stay the same.
When you select the Record Duplicate menu option, Superbase creates a copy
of the data for the current master file.
8-7
You can now edit the form if you wish, and when you're ready save it.
Superbase creates new records exactly as for Record New.
REMOVING FORM DATA: RECORD REMOVE
This option removes the current record for the current master file, as
indicated in the window title bar.
REPORTS
Report Forms differ from ordinary screen forms by being essentially program
driven. They are not intended to be viewed or printed as such. Instead of
seeing the report form, you see its output, either on the screen or the
printer. Chapter 7 of the Forms Editor Guide covers the use of the Forms
Editor as a report generator.
RUNNING A REPORT
There are two ways of running a report: opening the report form, or
executing the report program.
If you simply want the report to run without any further actions, choose
the Project Open Form option, and then select the report you want. The
report will execute as soon as it's loaded from disk.
The other choice is to treat the report like any other program. Select
Program Open, then the name of the report program you want. It will be in
the list of Superbase programs in the current directory.
Once the report program is loaded, you can either run it immediately, or
use the program editor to examine or modify the report program code. To do
the latter, select Program Edit.
ADDING FILTER CONDITIONS
The Forms Editor generates a WHERE line in the report program which
contains the default relational and sorting information derived from the
report form's internal structure.
The default relational information is only generated if more than one file
is used in the report form. It always takes the form
WHERE Field1.FILEA=Field2.FILEB ASK
where the fields contain the information on which a join can be made, such
as an
8-8
account number held in both files.
Access to the default filter is automatically provided when you run the
report program by the ASK statement at the end of the line.
When Superbase executes this instruction, it displays the standard Query
Filter Definition dialog, as obtainable from the Process Query Edit menu
option.
You may either click on OK, if you wish to make no changes, or add to the
Filter Command Line by clicking on fields and entering values and functions
to build up a more complex set of search conditions.
It would be unwise to remove the relational join, as Superbase is likely to
begin outputting extremely repetitive and confusing data, and to continue
for a very long time (the process won't harm your data).
Click on OK to call up the Order dialog.
ADDING ORDER CONDITIONS
The report generator derives a default sorting order from the groups in the
report form, or the first field in the SELECT line of the query if there
are no groups.
When you run the report, Superbase executes an ORDER line which includes
the command ASK. This causes the presentation of the Query Order dialog.
You may add extra fields to the Order line, or change sorting order from
ascending to descending for any particular field.
Click on OK to confirm your selections.
PRINT/DISPLAY OPTION
Before beginning output, the report program executes an instruction to
select Screen or Printer as the output device.
Indicate your preference and click on OK. The report program executes the
rest of its instructions.
8-9
MODIFYING A REPORT PROGRAM
It is quite likely that you will want to make some changes to the way your
report program executes. The main areas where changes are required are:
Specifying a fixed output device.
Specifying a fixed or extra default filter conditions.
Specifying a fixed or extra default order conditions.
OUTPUT DEVICE
The output device is selected with the line:
REQUEST "REPORT TO PRINTER?", "", 1A%
IF A% THEN PRINT;
To fix the output device as the printer, remove this line, and add the
statement TO PRINTER to the end of the report program (before the ENDSELECT
statement if there is one).
To fix the output device as the screen, remove the whole line: the default
output device is the screen.
To fix the output device as a disk file with the name "tempfile", remove
the line as above, and add TO FILE "tempfile" to the end of the report
program (before the ENDSELECT statement if there is one).
FILTER AND ORDER
You may want to extend the range of the default options, while keeping the
ability to add different parameters each time you run the report.
Edit the report program. Add any conditions you want to the WHERE line,
removing the ASK command only if you don't want the option to add
conditions at runtime. Do the same for the ORDER line to change or extend
the sorting parameters for the report.
FORMS AND THE PROJECT MENU
OPEN FIELDS
Each file has its own open fields list, which is not affected by using a
form.
CLOSE FORM
Use this option to close down the form display, thereby releasing the
memory
8-10
being used by the form when it is not displayed. The files used by the form
remain open, and the form's master file will become the current file,
unless another file has been opened meanwhile.
EDIT FILE
You may select this option to change the characteristics of a file
definition, but the action causes the form to be closed.
REMOVE FILE OR INDEX
You must close a form if you wish to remove any of the files associated
with it.
However, you may remove an index belonging to any of the files used in a
form. Be careful not to remove an index that is part of the link structure
of a form.
8-11
============================================================================
DOCS PROVIDED BY RAP AND -+*+-THE SOUTHERN STAR-+*+- for M.A.A.D.
============================================================================